package org.example.resouce;

/**
 * @Classname Test
 * @Description 获取文件位置
 * @Date 2020/12/11 10:28 上午
 * @Created by xiangjd
 */
public class Test {
    public static void main(String[] args) {
        System.out.println(Test.class.getResource("/").getPath());
        System.out.println(Test.class.getResource("").getPath());
        System.out.println(Test.class.getClassLoader().getResource("").getPath());
        //classLoader加了"/"直接为null
        System.out.println(Test.class.getClassLoader().getResource("/").getPath());

    }
}
